<?php
$title = 'Add News';
if(!empty($product['id'])){
	$title = 'Edit News';
}?>

<script type="text/javascript" src="<?php echo config_item('asset');?>js/tinymce/tiny_mce.js"></script>

<script type="text/javascript">
tinyMCE.init({
	theme : "simple",
    mode : "textareas"
});
</script>
<div id="page-heading"><input type="button" value="Back to News List" style="float: right;" id="admin-back-news-list"><h1><?php echo $title;?></h1></div>

<form action="<?php echo site_url('admin/save_news'); ?>" method="post" enctype="multipart/form-data">
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="<?php echo config_item('asset'),'admin/';?>images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="<?php echo config_item('asset'),'admin/';?>images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td>
	<!--  start content-table-inner -->
	<div id="content-table-inner">
	
	<table border="0" width="100%" cellpadding="0" cellspacing="0">
	<tr valign="top">
	<td align="center">
		<!-- start id-form -->
		<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
		<tr>
			<th valign="top">Title:</th>
			<?php if (!empty($news['id'])): ?>
				<input type="hidden" name="id" value="<?php echo $news['id']; ?>" id="id">
			<?php endif ?>
			<td><input type="text" class="inp-form" id="title" name="title" value="<?php echo element('title', $news) ?>" /></td>
			<td></td>
		</tr>
		<!-- <tr>
			<th valign="top">Slug:</th>
			<td><input type="text" class="inp-form" id="slug" name="slug" value="<?php echo element('slug', $news) ?>" /></td>
			<td>
			</td>
		</tr> -->
	<tr>
		<th valign="top">Description:</th>
		<td colspan="2"><textarea rows="30" cols="80" id="description" name="description"><?php echo element('description', $news) ?></textarea></td>
	</tr>
	<tr>
	<th>Thumb:</th>
	<td><input type="file" class="file_1" id="pic1" name="pic1" /></td>
	<td>
	
	</td>
	</tr>
	<tr>
		<th>&nbsp;</th>
		<td valign="top">
			<input type="submit" value="" class="form-submit" />
		</td>
		<td></td>
	</tr>
	</table>
	<!-- end id-form  -->

	</td>
</tr>
<tr>
</table>
 
<div class="clear"></div>
 

</div>
<!--  end content-table-inner  -->
</td>
<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</table>

</form>
<script type="text/javascript">
$('#admin-back-news-list').click(function(){
	window.location = '<?php echo site_url('admin/news');?>';
});
</script>